package com.sleepingcat.ft_jetpack.life_cycle

import com.cat.android.lib_base.base.RouterFragment
import com.cat.android.plugin_navigation_runtime.NavDestination
import com.sleepingcat.ft_jetpack.databinding.FragmentDemoLifeCycleBinding
import com.sleepingcat.lib_common.const.Routes

@NavDestination(type = NavDestination.NavType.Fragment, route = Routes.Jetpack.LIFE_CYCLE)
class DemoLifeCycleFragment : RouterFragment<FragmentDemoLifeCycleBinding>() {

    override fun initView() {
        super.initView()
        // mChronometer里实现了DefaultLifecycleObserver接口，可以在组件指定的生命周期执行对应的逻辑
        lifecycle.addObserver(binding.mChronometer)
    }
}